<html>
<head>
	<link href="resource/hdjs/css/bootstrap.min.css" rel="stylesheet">
	<link href="resource/hdjs/css/font-awesome.min.css" rel="stylesheet">
	<script src="resource/hdjs/js/jquery.min.js"></script>
	<script src="resource/hdjs/app/util.js"></script>
	<script src="resource/hdjs/require.js"></script>
	<script src="resource/hdjs/app/config.js"></script>
</head>
<body>
<nav class="navbar navbar-default" role="navigation">
	<div class="container-fluid">
		<div class="navbar-header">
			<a class="navbar-brand" href="http://localhost/weixin/index.php?s=admin/entry/index">wfeng</a>
		</div>
		<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
			<ul class="nav navbar-nav navbar-right">
				<li class="dropdown">
					<a href="#" class="dropdown-toggle" data-toggle="dropdown">admin <span class="caret"></span></a>
					<ul class="dropdown-menu" role="menu">
						<li><a href="http://localhost/weixin/index.php?s=admin/entry/quit">退出</a></li>
					</ul>
				</li>
			</ul>
		</div>
	</div>
</nav>
<div class="container">
	<div class="row">
		<div class="col-sm-4">
			<div class="list-group">
				<a href="#" class="list-group-item disabled">
					微信管理
				</a>
				<a href="http://localhost/weixin/index.php?s=admin/message/lists&m=base" class="list-group-item">消息管理</a>
				<a href="http://localhost/weixin/?s=admin/module/entry&a=site/lists&t=admin&m=button&" class="list-group-item">菜单管理</a>
				<a href="http://localhost/weixin/index.php?s=admin/message/lists&m=news" class="list-group-item">图文消息</a>
				<a href="http://localhost/weixin/index.php?s=admin/message/system" class="list-group-item">系统消息</a>
			</div>
			<div class="list-group">
				<a href="#" class="list-group-item disabled">
					素材管理
				</a>
				<a href="http://localhost/weixin/?s=admin/module/entry&a=site/imageLists&t=admin&m=material&" class="list-group-item">图片素材</a>
				<a href="http://localhost/weixin/?s=admin/module/entry&a=site/newsLists&t=admin&m=material&" class="list-group-item">图文素材</a>
			</div>
			<div class="list-group">
				<a href="#" class="list-group-item disabled">
					微官网
				</a>
				<a href="#" class="list-group-item">栏目管理</a>
				<a href="#" class="list-group-item">幻灯片</a>
				<a href="#" class="list-group-item">文章管理</a>
			</div>
		</div>
		<div class="col-sm-8">
			
<div>
    <button class="btn btn-success" onclick="upImage(this)">选择图片</button>
</div>
<br/>
<div class="panel panel-default">
	<div class="panel-body">
		<div class="view">
			<?php if(!empty($data)){foreach ($data as $d){?>
                <img src="<?php echo $d['path']?>" style="width: 200px;">
            <?php }}?>
		</div>
	</div>
</div>
<script>
    //上传图片
    function upImage(obj) {
        require(['util'], function (util) {
            util.image(function (images) {
                // obj = util.loading();
                $.post('<?php echo site_url("site/pushImage")?>', {file: images[0]}, function (res) {
                    //隐藏加载动画
                    // obj.modal('hide');
                    if (res == 1) {
                        util.message('上传成功', 'refresh', 'success');
                    } else {
                        util.message('上传失败,请检测文件大小', '', 'error');
                    }
                })
            }, [])
        });
    }
    //移除图片 
    function removeImg(obj) {
        $(obj).prev('img').attr('src', 'resource/images/nopic.jpg');
        $(obj).parent().prev().find('input').val('');
    }
</script>

		</div>
	</div>
</div>
</body>
</html>
<script>
	require(['bootstrap']);
</script>
<link rel="stylesheet" href="<?php echo __TEMPLATE__?>/css/css.css">
